-----------------------------------------------------------------------------
-- Licensed Materials - Property of IBM
-- 
-- Governed under the terms of the International
-- License Agreement for Non-Warranted Sample Code.
--
-- (C) COPYRIGHT International Business Machines Corp. 1995 - 2002        
-- All Rights Reserved.
--
-- US Government Users Restricted Rights - Use, duplication or
-- disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
-----------------------------------------------------------------------------
--
-- SOURCE FILE NAME: tbselcreate.db2
--    
-- SAMPLE: How to create the tables for the tbsel program
--
-- To run this script from the CLP, perform the following steps:
-- 1. connect to the database
-- 2. issue the command "db2 -td@ -vf <script-name>"
--    where <script-name> represents the name of this script
-----------------------------------------------------------------------------
-- For more information on the sample programs, see the README file.
--
-- For information on developing C applications, see the Application
-- Development Guide.
--
-- For information on using SQL statements, see the SQL Reference.
--
-- For the latest information on programming, building, and running DB2 
-- applications, visit the DB2 application development website: 
--     http://www.software.ibm.com/data/db2/udb/ad
-----------------------------------------------------------------------------

CREATE TABLE company_a 
         (ID SMALLINT NOT NULL UNIQUE, 
	 NAME VARCHAR(9), 
	 DEPARTMENT SMALLINT, 
	 JOB CHAR(5), 
	 YEARS SMALLINT, 
	 SALARY DECIMAL(7,2))@

CREATE TABLE company_b 
	 (ID SMALLINT GENERATED BY DEFAULT AS IDENTITY(START WITH 2000, INCREMENT BY 1) NOT NULL, 
	 NAME VARCHAR(9), 
	 DEPARTMENT SMALLINT, 
	 JOB CHAR(5), 
	 YEARS SMALLINT, 
	 SALARY DECIMAL(7,2), 
	 BENEFITS VARCHAR(50), 
	 OLD_ID SMALLINT)@
	   
CREATE TABLE salary_change 
	 (ID SMALLINT NOT NULL UNIQUE, 
	 OLD_SALARY DECIMAL(7,2), 
	 SALARY DECIMAL(7,2))@

